package cvo.pro4.chess.client.entities.pieces;


import java.util.List;

import cvo.pro4.chess.client.entities.BoardCoordinates;
import cvo.pro4.chess.client.entities.Color;
import cvo.pro4.chess.client.entities.Piece;
import cvo.pro4.chess.client.exceptions.IllegalCoordinatesException;

public class Bishop extends Piece{
	
	public Bishop(Color color){
	 super(color);
	 setName("Bishop");
	}
	
	@Override
	public void move(BoardCoordinates coordinates){
		
	}

	public List<BoardCoordinates> getPossibleMoves() throws IllegalCoordinatesException {
/*		List<BoardCoordinates> list = null;
		
		Integer x=this.getPosition().getX();
		Integer y=this.getPosition().getY();
		BoardCoordinates possiblePosition=this.getPosition();
		Color ownColor=this.getColor();
		
		
				
		
		BoardCoordinates.create(x++, y++);
		while(possiblePosition!=null){			
			Tile tile= GameFacade.getGameFacade().getTileAt(possiblePosition.toString());
			if(tile!=null && !tile.getIsOccupied()){
				list.add(possiblePosition);
				BoardCoordinates.create(x++, y++);
			}else if(tile!=null && tile.getPiece().getColor()!=ownColor){
				list.add(possiblePosition);
				break;
			}			
		}
		possiblePosition=this.getPosition();
		x=this.getPosition().getX();
		y=this.getPosition().getY();
		
		BoardCoordinates.create(x++, y--);
		while(possiblePosition!=null){			
			Tile tile= GameFacade.getGameFacade().getTileAt(possiblePosition.toString());
			if(tile!=null && !tile.getIsOccupied()){
				list.add(possiblePosition);
				BoardCoordinates.create(x++, y--);
			}else if(tile!=null && tile.getPiece().getColor()!=ownColor){
				list.add(possiblePosition);
				break;
			}			
		}
		possiblePosition=this.getPosition();
		x=this.getPosition().getX();
		y=this.getPosition().getY();
		BoardCoordinates.create(x--, y++);
		while(possiblePosition!=null){			
			Tile tile= GameFacade.getGameFacade().getTileAt(possiblePosition.toString());
			if(tile!=null && !tile.getIsOccupied()){
				list.add(possiblePosition);
				BoardCoordinates.create(x--, y++);
			}else if(tile!=null && tile.getPiece().getColor()!=ownColor){
				list.add(possiblePosition);
				break;
			}			
		}
		possiblePosition=this.getPosition();
		x=this.getPosition().getX();
		y=this.getPosition().getY();
		BoardCoordinates.create(x--, y--);
		while(possiblePosition!=null){			
			Tile tile= GameFacade.getGameFacade().getTileAt(possiblePosition.toString());
			if(tile!=null && !tile.getIsOccupied()){
				list.add(possiblePosition);
				BoardCoordinates.create(x--, y--);
			}else if(tile!=null && tile.getPiece().getColor()!=ownColor){
				list.add(possiblePosition);
				break;
			}			
		}
*/
		// TODO control of bishop 
//		return list;
		return null;
	}
}
